package designpatterns.strategy;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2022/1/28 8:50
 */
public class AppTest {


    private static final Logger logger = LoggerFactory.getLogger(AppTest.class);

    @Test
    public void test(){
        Context context = new Context(new CalculateAdd());
        int i = context.executeStrategy(1, 2);
        logger.info(String.valueOf(i));

        context = new Context(new CalculateSub());
        int i1 = context.executeStrategy(2, 3);
        logger.info(String.valueOf(i1));
    }

}
